package com.sk.bilibili.adapter.pager.them;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.sk.bilibili.adapter.pager.BaseFragmentAdapter;
import com.sk.bilibili.view.fragment.DiscussFragment;
import com.sk.bilibili.view.fragment.them.IntroductionFragment;

public class ThemFragmentAdapter extends BaseFragmentAdapter {

    private Integer themId;

    public ThemFragmentAdapter(@NonNull FragmentManager fm,Integer themId) {
        super(fm);
        this.themId=themId;
        initData();
    }

    private static final String[] TITLES ="简介,评论".split(",");

    @Override
    protected String[] getTitles() {
        return TITLES;
    }

    @Override
    protected Fragment[] getFragments() {
        Fragment[] fragments=new Fragment[2];
        fragments[0]=new IntroductionFragment(themId);
        fragments[1]=new DiscussFragment(themId,1);
        return fragments;
    }

    public void setDiscussNum(Integer discussNum) {
        TITLES[1]="评论"+discussNum;
        notifyDataSetChanged();
    }

}